package org.example;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test1
{
    public static void main(String[] args)
    {
        //获取字符串
        Scanner sc = new Scanner(System.in);
        StringBuilder sb1 = new StringBuilder();
        while (sc.hasNextLine())
        {
            String line = sc.nextLine();
            if (line.equalsIgnoreCase("done"))
            { // 假设输入"done"表示结束
                break;
            }
            sb1.append(line).append("\n"); // 保留换行符
        }
        String str1 = sb1.toString().replaceAll("/(.+?(?:;\\s+)*)+?/", "");
        str1 = str1.replaceAll("\\s+", " ");

        //中文（不含生僻字和中文符号）：\\u4e00-\\u9fff
        //((?:(?:[a-zA-Z/’()…!?=]|\.\.\.)+ )+)(.+?)(?=p.\d)
        //所有词性：(?:n)|(?:pron)|(?:v)|(?:adj)|(?:adv)|(?:prep)|(?:conj)|(?:interj)|(?:art)|(?:num)|(?:modal v).
        Pattern pattern = Pattern.compile("(.+?) *((?:(?:n|pron|v|adj|adv|prep|conj|interj|art|num|modal v)\\.|[\\u4e00-\\u9fff（]).*?) p\\.\\d+ ");
        Matcher matcher = pattern.matcher(str1);
        System.out.println(str1);

        List<String[]> matches = new ArrayList<>();
        while (matcher.find())
        {
            matches.add(new String[]{matcher.group(1), matcher.group(2)});
        }

        for (String[] match : matches) {
            System.out.println(match[0]);
        }
        for (String[] match : matches) {
            System.out.println(match[1]);
        }
    }
}
